package com.neuedu.grainsapi.controller;

import com.neuedu.grainsapi.pojo.CropTrend;
import com.neuedu.grainsapi.service.CropRanksService;
import com.neuedu.grainsapi.service.CropTrendService;
import com.neuedu.grainsapi.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CropTrendController {
    @Autowired
    private CropTrendService cropTrendService;
    @GetMapping("/queryCropTrend")
    public ResponseResult<List<CropTrend>> queryCropTrend(){
        List<CropTrend> cropTrends = cropTrendService.queryCropTrend();
        return new ResponseResult<>("200","yes",cropTrends);
    }
}
